 <%@page import="databaseLayer.StatisticsLookUp" %>
<%@page import="databaseLayer.MoviesLookUp" %>
<%@page import="statistics.*" %>
<%@page import="movieBean.Movie" %>
<%@page import="movieBean.MovieSlot" %>

<head>
      
    <% MovieSlotStatistics statistics = StatisticsLookUp.getMovieSlotStatistics(request.getParameter("slotID"));
    %>
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">
      google.load("visualization", "1", {packages:["corechart"]});
      google.setOnLoadCallback(drawChart);
      function drawChart() {
        var data = google.visualization.arrayToDataTable([
            ['State', 'Amount'],
            ['Bought',     <%= statistics.getBought() %>],
            ['Available',      <%= statistics.getAvailable() %>],
            ['Unavailable',  <%= statistics.getUnavailable() %>],
        ]);

        var options = {
          title: '<%= request.getParameter("movieName") + " (" + request.getParameter("time") + ")"%>'
        };

        var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
        chart.draw(data, options);
      }
    </script>
  </head>
  <body>
    <h2>Movie Slot Statistics</h20>
    <p><%= request.getParameter("slotID") %> </p>
    <div id="chart_div" style="width: 900px; height: 500px;"></div>
  </body>